'   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 '   Q%  T M O T   T E S T E R   -   V a r i a b l e   S p e e d                                 Q%
 
 '   _% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %b%
 
 '   Q%  V e r s i o n   3                                                                       Q%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     U N C O M M E N T   T H I S   L I N E   I F   U S I N G   T H E   P R O T O T Y P E   " A " 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' P R O T O T Y P E   =   " A " 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - -   M O T O R   P A R A M E T E R S 
 
 V a r i a b l e   S t r i n g   P R O T O T Y P E 
 
 I f   P R O T O T Y P E   =   " A " 
 
 	 M a x P W M   =   5 3 0 
 
 	 M a x R P M   =   2 0 0 0 
 
 E l s e 
 
 	 M a x P W M   =   1 0 0 0 
 
 	 M a x R P M   =   4 0 0 0 
 
 E n d I f 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - -   B U T T O N S   a n d   K E Y S 
 
 B u t t o n   1   T e x t   3 5 0 0   R P M 
 
 B u t t o n   2   T e x t   3 0 0 0   R P M 
 
 B u t t o n   3   T e x t   2 0 0 0   R P M 
 
 B u t t o n   4   T e x t   1 0 0 0   R P M 
 
 
 
 B u t t o n   6   T e x t   - 3 5 0 0   R P M 
 
 B u t t o n   7   T e x t   - 3 0 0 0   R P M 
 
 B u t t o n   8   T e x t   - 2 0 0 0   R P M 
 
 B u t t o n   9   T e x t   - 1 0 0 0   R P M 
 
 
 
 B u t t o n   1 1   T e x t   S t o p M o t o r 
 
 B u t t o n   S t o p M o t o r   C o l o r   G o l d 
 
 
 
 B u t t o n   1 7   T e x t   + 1 0 0   R P M 
 
 B u t t o n   1 8   T e x t   - 1 0 0   R P M 
 
 
 
 B u t t o n   2 0   T e x t   + 1 0   R P M 
 
 B u t t o n   2 1   T e x t   - 1 0   R P M 
 
 
 
 B u t t o n   2 3   T e x t   + 1   R P M 
 
 B u t t o n   2 4   T e x t   - 1   R P M 
 
 
 
 K e y   U p       R e a d K e y s 
 
 K e y   D o w n   R e a d K e y s 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   A P P S 
 
 L o a d   " T h e r e m i n o _ R S 4 8 5 . e x e " 
 
 L o a d   " T h e r e m i n o _ S l o t V i e w e r . e x e " 
 
 L o a d   " T h e r e m i n o _ S i g n a l S c o p e 1 . e x e " 
 
 L o a d   " T h e r e m i n o _ S i g n a l S c o p e 2 . e x e " 
 
 ' L o a d   " T h e r e m i n o _ H a l . e x e " 
 
 L o a d   " C : \ P r o g r a m   F i l e s   ( x 8 6 ) \ P i c o   T e c h n o l o g y \ P i c o S c o p e 6 \ P i c o S c o p e . e x e " 
 
 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S T A R T 
 
 O p t i o n   S p e e d   9 
 
 W o r k i n g M o d e V e l o c i t y 
 
 G o s u b   L o o p 
 
 S t o p 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S T O P 
 
 L a b e l   E v e n t S t o p 
 
 	 S t o p M o t o r 
 
 E n d 
 
 
 
 L a b e l   S t o p M o t o r 
 
 	 R P M   =   0 
 
 	 F o r   v 1   =   1   T o   3 0 0 
 
 	 	 U p d a t e M o t o r V a l u e s 
 
 	 	 I f   A b s ( R p m S m o o t h e d )   <   0 . 0 1 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 N e x t 
 
 	 S l o t   1 6 2   =   0 
 
 	 S l o t   1 6 6   =   0 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   W O R K I N G   M O D E   V E L O C I T Y 
 
 L a b e l   W o r k i n g M o d e V e l o c i t y 
 
 	 S l o t ( 1 5 0 )   =   1   '   W r i t e - P r o t e c t i o n   O N 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t ( 1 5 0 )   =   0   '   W r i t e - P r o t e c t i o n   O F F 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t ( 1 5 1 )   =   0   '   W o r k i n g   m o d e   =   N o t h i n g 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t ( 1 5 1 )   =   2   '   W o r k i n g   m o d e   =   V e l o c i t y 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t ( 1 5 0 )   =   1   '   W r i t e - P r o t e c t i o n   O N 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   B U T T O N   E X E C U T I O N 
 
 L a b e l   3 5 0 0   R P M 
 
 	 R P M   =   3 5 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   3 0 0 0   R P M 
 
 	 R P M   =   3 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   2 0 0 0   R P M 
 
 	 R P M   =   2 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   1 0 0 0   R P M 
 
 	 R P M   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   - 3 5 0 0   R P M 
 
 	 R P M   =   - 3 5 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   - 3 0 0 0   R P M 
 
 	 R P M   =   - 3 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   - 2 0 0 0   R P M 
 
 	 R P M   =   - 2 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   - 1 0 0 0   R P M 
 
 	 R P M   =   - 1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   + 1 0 0   R P M 
 
 	 R P M   =   R P M   +   1 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   - 1 0 0   R P M 
 
 	 R P M   =   R P M   -   1 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   + 1 0   R P M 
 
 	 R P M   =   R P M   +   1 0 
 
 R e t u r n 
 
 
 
 L a b e l   - 1 0   R P M 
 
 	 R P M   =   R P M   -   1 0 
 
 R e t u r n 
 
 
 
 L a b e l   + 1   R P M 
 
 	 R P M   =   R P M   +   1 
 
 R e t u r n 
 
 
 
 L a b e l   - 1   R P M 
 
 	 R P M   =   R P M   -   1 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   K E Y S 
 
 L a b e l   R e a d K e y s 
 
 	 V a r i a b l e   N u m e r i c   J o g S p e e d   =   1 0 0 
 
 	 S e l e c t   T r u e 
 
 	 	 ' C a s e   K e y ( " S H I F T " ) 
 
 	 	 ' 	 J o g S p e e d   =   J o g S p e e d   *   0 . 1 
 
 	 	 C a s e   K e y ( " C T R L " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 1 
 
 	 	 C a s e   K e y ( " A L T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 0 1 
 
 	 E n d S e l e c t 
 
 	 I f   K e y ( " U P " ) 
 
 	 	 R P M   =   I n t ( R P M   +   J o g S p e e d ) 
 
 	 	 P r i n t   R P M 
 
 	 E n d I f 
 
 	 I f   K e y ( " D O W N " ) 
 
 	 	 R P M   =   I n t ( R P M   -   J o g S p e e d ) 
 
 	 	 P r i n t   R P M 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 '   Q%  L O O P   a n d   M O T O R   C O N T R O L                                           Q%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 L a b e l   L o o p 
 
 	 U p d a t e M o t o r V a l u e s 
 
 	 W a i t   S e c o n d s   0 . 0 1 
 
 G o t o   L o o p 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   M O T O R   C O N T R O L 
 
 V a r i a b l e   N u m e r i c   R P M 
 
 V a r i a b l e   N u m e r i c   R p m S m o o t h e d 
 
 V a r i a b l e   N u m e r i c   M a x P W M 
 
 V a r i a b l e   N u m e r i c   M a x R P M 
 
 
 
 L a b e l   U p d a t e M o t o r V a l u e s 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - -   u p d a t e   G o a l P o s i t i o n 
 
 	 S l o t ( 1 5 8 )   =   S l o t ( 1 1 0 ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 R P M   =   M i n ( R P M ,   M a x R P M ) 
 
 	 R P M   =   M a x ( R P M ,   - M a x R P M ) 
 
 	 R p m S m o o t h e d   =   F i l t e r L P ( R P M ,   1 ,   8 ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - -   d r i v e   t h e   m o t o r 
 
 	 I f   A b s ( R p m S m o o t h e d )   >   0 . 5 
 
 	 	 S l o t   1 6 2   =   M a x P W M 
 
 	 	 S l o t   1 6 6   =   R p m S m o o t h e d 
 
 	 	 P r i n t   R P M 
 
 	 E l s e 
 
 	 	 ' S l o t   1 6 2   =   0 
 
 	 	 ' S l o t   1 6 6   =   0 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 
 
 